import torch

m3 = torch.nn.BatchNorm2d(3, eps=0, momentum=0.5, affine=True, track_running_stats=True).cuda()
# m3 = torch.nn.BatchNorm2d(3).cuda()
# 为了方便验证，设置模型参数的值
m3.running_mean = (torch.ones([3]) * 4).cuda()  # 设置模型的均值是4
m3.running_var = (torch.ones([3]) * 2).cuda()  # 设置模型的方差是2

# # 查看模型参数的值
# print('trainning:', m3.training)
# print('running_mean:', m3.running_mean)
# print('running_var:', m3.running_var)
# # gamma对应模型的weight，默认值是1
# print('weight:', m3.weight)
# # gamma对应模型的bias，默认值是0
# print('bias:', m3.bias)


torch.manual_seed(21)
input3 = torch.randn(1, 3, 416, 416).cuda()
print()